import { ref } from "vue"

function useCollapse(option?: { defaultVisible: boolean }) {

  let collapseVisible = ref(option?.defaultVisible ? option.defaultVisible : false)

  function openCollapse() {
    collapseVisible.value = true
  }
  function closeCollapse() {
    collapseVisible.value = false
  }
  return {
    collapseVisible,
    openCollapse,
    closeCollapse
  }
}

export default useCollapse